package CreationModel.PrototypeModel.DeepAndShallowClone.DeepCloneOne;

import java.io.IOException;

/**
 * @author 王蕾 [wanglei_dev@cyou-inc.com]
 * @date 2017-12-06 17:32:00
 */
public class SwallowClient {

    public static void main(String[] args) throws  CloneNotSupportedException, ClassNotFoundException, IOException {

        Swallow swallow1 = new Swallow("大雁a", new Wing(10), new Wing(10));

        Swallow swallow2 = (Swallow)swallow1.clone();

        System.out.println("(s1==s2)="+ (swallow1==swallow2));
        System.out.println("s1.name="+ swallow1.getName()+", s2.name="+swallow2.getName());
        System.out.println("(s1.leftWing==s2.leftWing) = "+(swallow1.getLeftWing()==swallow2.getLeftWing()));
        System.out.println("(s1.rightWing==s2.rightWing) = "+(swallow1.getRightWing()==swallow2.getRightWing()));

    }
}
